<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="skripte/proba1.js"></script>
<title>Proba</title>
</head>
<body>
<form name="forma1">
<input type="text" id="x"> 
<button type="button" onclick="myFunction()">Probaj</button>
</form>
<div id="test">
<script type="text/javascript">
function myFunction()
{
	var req = createRequest(); // defined above
	// Create the callback:
	req.onreadystatechange = function() {
	  if (req.readyState != 4) return; // Not there yet
	  if (req.status != 200) {
	    // Handle request failure here...
	    return;
	  }
	  // Request successful, read the response
	  var resp = req.responseText;
	  // ... and use it as needed by your app.
	  document.getElementById("test").textContent=resp;
	  return;
	}
	req.open("POST","https://localhost:8443/ProbaREST/resources/test", true);
	req.setRequestHeader("Content-Type",
	                     "application/x-www-form-urlencoded");
	var salji=document.getElementById("x").value;
	req.send("ulaz="+salji);
}
</script>
</div>
</body>
</html>